home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| dexmagic
| PrintFox/Pagefox WEAK
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/950 MIME Email (1.0)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/news
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 73 64 | 63 63 31 32 2e 75 63 73 |Path: sd|cc12.ucs|
|00000010| 64 2e 65 64 75 21 67 6f | 6c 67 69 21 6a 73 74 72 |d.edu!go|lgi!jstr|
|00000020| 6f 75 74 0a 46 72 6f 6d | 3a 20 4a 6f 73 65 70 68 |out.From|: Joseph|
|00000030| 20 53 74 72 6f 75 74 20 | 3c 6a 73 74 72 6f 75 74 | Strout |<jstrout|
|00000040| 40 75 63 73 64 2e 65 64 | 75 3e 0a 4e 65 77 73 67 |@ucsd.ed|u>.Newsg|
|00000050| 72 6f 75 70 73 3a 20 63 | 6f 6d 70 2e 6c 61 6e 67 |roups: c|omp.lang|
|00000060| 2e 63 2b 2b 0a 53 75 62 | 6a 65 63 74 3a 20 52 65 |.c++.Sub|ject: Re|
|00000070| 3a 20 43 61 6e 20 73 6f | 6d 65 62 6f 64 79 20 65 |: Can so|mebody e|
|00000080| 78 70 6c 61 69 6e 20 6d | 65 20 68 6f 77 20 74 6f |xplain m|e how to|
|00000090| 20 64 6f 20 74 68 69 73 | 20 69 6e 20 43 2b 2b 0a | do this| in C++.|
|000000a0| 44 61 74 65 3a 20 54 68 | 75 2c 20 37 20 4d 61 72 |Date: Th|u, 7 Mar|
|000000b0| 20 31 39 39 36 20 31 30 | 3a 35 35 3a 31 34 20 2d | 1996 10|:55:14 -|
|000000c0| 30 38 30 30 0a 4f 72 67 | 61 6e 69 7a 61 74 69 6f |0800.Org|anizatio|
|000000d0| 6e 3a 20 55 6e 69 76 65 | 72 73 69 74 79 20 6f 66 |n: Unive|rsity of|
|000000e0| 20 43 61 6c 69 66 6f 72 | 6e 69 61 2c 20 53 61 6e | Califor|nia, San|
|000000f0| 20 44 69 65 67 6f 0a 4d | 65 73 73 61 67 65 2d 49 | Diego.M|essage-I|
|00000100| 44 3a 20 3c 50 69 6e 65 | 2e 53 47 49 2e 33 2e 39 |D: <Pine|.SGI.3.9|
|00000110| 31 2e 39 36 30 33 30 37 | 31 30 34 38 35 35 2e 32 |1.960307|104855.2|
|00000120| 38 35 32 30 42 2d 31 30 | 30 30 30 30 40 67 6f 6c |8520B-10|0000@gol|
|00000130| 67 69 3e 0a 52 65 66 65 | 72 65 6e 63 65 73 3a 20 |gi>.Refe|rences: |
|00000140| 3c 34 68 6b 62 32 6f 24 | 6b 6f 33 40 6d 6f 36 2e |<4hkb2o$|ko3@mo6.|
|00000150| 72 63 2e 74 75 64 65 6c | 66 74 2e 6e 6c 3e 0a 4e |rc.tudel|ft.nl>.N|
|00000160| 4e 54 50 2d 50 6f 73 74 | 69 6e 67 2d 48 6f 73 74 |NTP-Post|ing-Host|
|00000170| 3a 20 67 6f 6c 67 69 2e | 75 63 73 64 2e 65 64 75 |: golgi.|ucsd.edu|
|00000180| 0a 4d 69 6d 65 2d 56 65 | 72 73 69 6f 6e 3a 20 31 |.Mime-Ve|rsion: 1|
|00000190| 2e 30 0a 43 6f 6e 74 65 | 6e 74 2d 54 79 70 65 3a |.0.Conte|nt-Type:|
|000001a0| 20 54 45 58 54 2f 50 4c | 41 49 4e 3b 20 63 68 61 | TEXT/PL|AIN; cha|
|000001b0| 72 73 65 74 3d 55 53 2d | 41 53 43 49 49 0a 58 2d |rset=US-|ASCII.X-|
|000001c0| 53 65 6e 64 65 72 3a 20 | 6a 73 74 72 6f 75 74 40 |Sender: |jstrout@|
|000001d0| 67 6f 6c 67 69 0a 49 6e | 2d 52 65 70 6c 79 2d 54 |golgi.In|-Reply-T|
|000001e0| 6f 3a 20 3c 34 68 6b 62 | 32 6f 24 6b 6f 33 40 6d |o: <4hkb|2o$ko3@m|
|000001f0| 6f 36 2e 72 63 2e 74 75 | 64 65 6c 66 74 2e 6e 6c |o6.rc.tu|delft.nl|
|00000200| 3e 20 0a 0a 4f 6e 20 36 | 20 4d 61 72 20 31 39 39 |> ..On 6| Mar 199|
|00000210| 36 2c 20 45 6a 6f 20 53 | 63 68 72 61 6d 61 20 77 |6, Ejo S|chrama w|
|00000220| 72 6f 74 65 3a 0a 0a 3e | 20 79 6f 75 20 6f 6e 6c |rote:..>| you onl|
|00000230| 79 20 77 61 6e 74 20 74 | 6f 20 64 65 61 6c 20 77 |y want t|o deal w|
|00000240| 69 74 68 20 61 20 6c 69 | 6e 6b 65 64 20 6c 69 73 |ith a li|nked lis|
|00000250| 74 20 6f 66 20 62 61 73 | 65 20 63 6c 61 73 73 20 |t of bas|e class |
|00000260| 6f 62 6a 65 63 74 73 0a | 3e 20 77 68 69 63 68 20 |objects.|> which |
|00000270| 61 72 65 20 61 63 63 65 | 73 73 65 64 20 76 69 61 |are acce|ssed via|
|00000280| 20 61 20 77 68 69 6c 65 | 20 6c 6f 6f 70 2e 20 2e | a while| loop. .|
|00000290| 2e 2e 0a 0a 42 75 74 20 | 74 68 65 6e 20 77 72 6f |....But |then wro|
|000002a0| 74 65 3a 0a 0a 3e 20 53 | 6f 20 66 61 72 20 74 68 |te:..> S|o far th|
|000002b0| 65 72 65 20 69 73 20 6e | 6f 20 70 72 6f 62 6c 65 |ere is n|o proble|
|000002c0| 6d 20 75 6e 74 69 6c 20 | 74 68 65 20 66 6f 6c 6c |m until |the foll|
|000002d0| 6f 77 69 6e 67 20 73 69 | 74 75 61 74 69 6f 6e 20 |owing si|tuation |
|000002e0| 68 61 70 70 65 6e 73 2e | 20 54 68 65 72 65 20 61 |happens.| There a|
|000002f0| 72 65 20 0a 3e 20 6c 6f | 63 61 6c 20 76 61 72 69 |re .> lo|cal vari|
|00000300| 61 62 6c 65 73 20 64 65 | 63 6c 61 72 65 64 20 61 |ables de|clared a|
|00000310| 73 20 70 72 6f 74 65 63 | 74 65 64 20 64 61 74 61 |s protec|ted data|
|00000320| 20 69 6e 73 69 64 65 20 | 74 68 65 20 69 6e 68 65 | inside |the inhe|
|00000330| 72 65 74 65 64 20 73 75 | 62 63 6c 61 73 73 65 73 |reted su|bclasses|
|00000340| 20 0a 3e 20 28 77 68 69 | 63 68 20 64 6f 6e 27 74 | .> (whi|ch don't|
|00000350| 20 65 78 69 73 74 20 69 | 6e 20 74 68 65 20 62 61 | exist i|n the ba|
|00000360| 73 65 63 6c 61 73 73 29 | 20 61 6e 64 20 49 20 77 |seclass)| and I w|
|00000370| 61 6e 74 20 74 6f 20 61 | 63 63 65 73 73 20 74 68 |ant to a|ccess th|
|00000380| 6f 73 65 20 76 61 72 69 | 61 62 6c 65 73 0a 3e 20 |ose vari|ables.> |
|00000390| 69 6e 20 74 68 65 20 77 | 68 69 6c 65 20 63 6f 6e |in the w|hile con|
|000003a0| 73 74 72 75 63 74 69 6f | 6e 20 64 65 73 63 72 69 |structio|n descri|
|000003b0| 62 65 64 20 61 62 6f 76 | 65 2e 20 0a 0a 4e 6f 2c |bed abov|e. ..No,|
|000003c0| 20 79 6f 75 20 64 6f 6e | 27 74 2e 20 20 43 2b 2b | you don|'t. C++|
|000003d0| 20 64 6f 65 73 6e 27 74 | 20 6c 65 74 20 79 6f 75 | doesn't| let you|
|000003e0| 20 64 6f 20 74 68 69 73 | 20 62 65 63 61 75 73 65 | do this| because|
|000003f0| 20 69 74 27 73 20 6c 6f | 67 69 63 61 6c 6c 79 20 | it's lo|gically |
|00000400| 0a 69 6e 76 61 6c 69 64 | 2e 20 20 59 6f 75 27 76 |.invalid|. You'v|
|00000410| 65 20 67 6f 74 20 61 20 | 6c 69 6e 6b 65 64 20 6c |e got a |linked l|
|00000420| 69 73 74 20 6f 66 20 42 | 41 53 45 20 43 4c 41 53 |ist of B|ASE CLAS|
|00000430| 53 20 6f 62 6a 65 63 74 | 73 3b 20 79 6f 75 20 63 |S object|s; you c|
|00000440| 61 6e 27 74 20 67 6f 20 | 0a 61 72 6f 75 6e 64 20 |an't go |.around |
|00000450| 74 72 65 61 74 69 6e 67 | 20 74 68 65 6d 20 6c 69 |treating| them li|
|00000460| 6b 65 20 64 65 72 69 76 | 65 64 20 63 6c 61 73 73 |ke deriv|ed class|
|00000470| 20 6f 62 6a 65 63 74 73 | 2e 20 20 49 6e 20 61 64 | objects|. In ad|
|00000480| 64 69 74 69 6f 6e 2c 20 | 74 68 6f 73 65 20 0a 76 |dition, |those .v|
|00000490| 61 72 69 61 62 6c 65 73 | 20 61 72 65 20 70 72 6f |ariables| are pro|
|000004a0| 74 65 63 74 65 64 2c 20 | 73 6f 20 79 6f 75 20 63 |tected, |so you c|
|000004b0| 6f 75 6c 64 6e 27 74 20 | 61 63 63 65 73 73 20 74 |ouldn't |access t|
|000004c0| 68 65 6d 20 61 6e 79 77 | 61 79 21 0a 0a 4c 65 74 |hem anyw|ay!..Let|
|000004d0| 27 73 20 6d 61 6b 65 20 | 61 20 63 6f 6e 63 72 65 |'s make |a concre|
|000004e0| 74 65 20 65 78 61 6d 70 | 6c 65 2e 20 20 59 6f 75 |te examp|le. You|
|000004f0| 27 76 65 20 67 6f 74 20 | 61 20 63 6f 6c 6c 65 63 |'ve got |a collec|
|00000500| 74 69 6f 6e 20 28 6c 69 | 6e 6b 65 64 20 6c 69 73 |tion (li|nked lis|
|00000510| 74 2c 20 0a 77 68 61 74 | 65 76 65 72 29 20 6f 66 |t, .what|ever) of|
|00000520| 20 56 65 68 69 63 6c 65 | 73 2e 20 20 4e 6f 77 2c | Vehicle|s. Now,|
|00000530| 20 79 6f 75 20 73 61 79 | 2c 20 79 6f 75 20 77 61 | you say|, you wa|
|00000540| 6e 74 20 74 6f 20 61 63 | 63 65 73 73 20 74 68 65 |nt to ac|cess the|
|00000550| 20 22 77 69 6e 67 73 70 | 61 6e 22 20 0a 6d 65 6d | "wingsp|an" .mem|
|00000560| 62 65 72 20 6f 66 20 74 | 68 65 20 69 74 65 6d 73 |ber of t|he items|
|00000570| 20 69 6e 20 79 6f 75 72 | 20 6c 69 73 74 2c 20 62 | in your| list, b|
|00000580| 65 63 61 75 73 65 20 79 | 6f 75 20 6b 6e 6f 77 20 |ecause y|ou know |
|00000590| 28 74 68 6f 75 67 68 20 | 79 6f 75 27 72 65 20 6e |(though |you're n|
|000005a0| 6f 74 20 0a 74 65 6c 6c | 69 6e 67 20 74 68 65 20 |ot .tell|ing the |
|000005b0| 63 6f 6d 70 69 6c 65 72 | 29 20 74 68 61 74 20 69 |compiler|) that i|
|000005c0| 6e 20 74 68 69 73 20 63 | 61 73 65 2c 20 61 6c 6c |n this c|ase, all|
|000005d0| 20 74 68 6f 73 65 20 56 | 65 68 69 63 6c 65 73 20 | those V|ehicles |
|000005e0| 61 72 65 20 72 65 61 6c | 6c 79 20 0a 41 69 72 70 |are real|ly .Airp|
|000005f0| 6c 61 6e 65 73 2e 20 20 | 54 68 65 20 63 6f 6d 70 |lanes. |The comp|
|00000600| 69 6c 65 72 20 77 6f 6e | 27 74 20 6c 65 74 20 79 |iler won|'t let y|
|00000610| 6f 75 20 64 6f 20 69 74 | 20 62 65 63 61 75 73 65 |ou do it| because|
|00000620| 0a 0a 09 31 2e 20 56 65 | 68 69 63 6c 65 73 2c 20 |...1. Ve|hicles, |
|00000630| 69 6e 20 67 65 6e 65 72 | 61 6c 2c 20 64 6f 6e 27 |in gener|al, don'|
|00000640| 74 20 68 61 76 65 20 61 | 20 77 69 6e 67 73 70 61 |t have a| wingspa|
|00000650| 6e 0a 09 32 2e 20 45 76 | 65 6e 20 69 66 20 74 68 |n..2. Ev|en if th|
|00000660| 65 79 20 64 69 64 2c 20 | 69 74 27 73 20 70 72 6f |ey did, |it's pro|
|00000670| 74 65 63 74 65 64 3a 20 | 6e 6f 20 70 75 62 6c 69 |tected: |no publi|
|00000680| 63 20 61 63 63 65 73 73 | 20 61 6c 6c 6f 77 65 64 |c access| allowed|
|00000690| 0a 0a 49 20 74 68 69 6e | 6b 20 69 74 27 73 20 71 |..I thin|k it's q|
|000006a0| 75 69 74 65 20 72 69 67 | 68 74 2e 20 20 59 6f 75 |uite rig|ht. You|
|000006b0| 20 65 69 74 68 65 72 20 | 6e 65 65 64 20 74 6f 20 | either |need to |
|000006c0| 63 68 61 6e 67 65 20 74 | 68 65 20 63 6c 61 73 73 |change t|he class|
|000006d0| 20 73 74 72 75 63 74 75 | 72 65 20 0a 73 6f 20 74 | structu|re .so t|
|000006e0| 68 61 74 20 61 6c 6c 20 | 56 65 68 69 63 6c 65 73 |hat all |Vehicles|
|000006f0| 20 68 61 76 65 20 61 20 | 70 75 62 6c 69 63 6c 79 | have a |publicly|
|00000700| 20 61 63 63 65 73 73 69 | 62 6c 65 20 77 69 6e 67 | accessi|ble wing|
|00000710| 73 70 61 6e 2c 20 6f 72 | 20 63 68 61 6e 67 65 20 |span, or| change |
|00000720| 79 6f 75 72 20 0a 63 6f | 6e 74 61 69 6e 65 72 20 |your .co|ntainer |
|00000730| 73 6f 20 69 74 20 63 6f | 6e 74 61 69 6e 73 20 6f |so it co|ntains o|
|00000740| 6e 6c 79 20 41 69 72 70 | 6c 61 6e 65 73 20 28 61 |nly Airp|lanes (a|
|00000750| 6e 64 20 6d 61 6b 65 20 | 77 69 6e 67 73 70 61 6e |nd make |wingspan|
|00000760| 20 70 75 62 6c 69 63 29 | 2e 0a 0a 4f 66 20 63 6f | public)|...Of co|
|00000770| 75 72 73 65 2c 20 69 66 | 20 79 6f 75 20 68 61 76 |urse, if| you hav|
|00000780| 65 20 61 20 63 6f 6e 74 | 61 69 6e 65 72 20 6f 66 |e a cont|ainer of|
|00000790| 20 70 6f 69 6e 74 65 72 | 73 20 74 6f 20 56 65 68 | pointer|s to Veh|
|000007a0| 69 63 6c 65 73 2c 20 79 | 6f 75 20 63 61 6e 20 0a |icles, y|ou can .|
|000007b0| 74 79 70 65 63 61 73 74 | 20 74 68 65 20 70 6f 69 |typecast| the poi|
|000007c0| 6e 74 65 72 2e 20 20 54 | 68 69 73 20 73 61 79 73 |nter. T|his says|
|000007d0| 20 74 6f 20 74 68 65 20 | 63 6f 6d 70 69 6c 65 72 | to the |compiler|
|000007e0| 2c 20 22 54 72 75 73 74 | 20 6d 65 2c 20 74 68 65 |, "Trust| me, the|
|000007f0| 79 27 72 65 20 0a 72 65 | 61 6c 6c 79 20 41 69 72 |y're .re|ally Air|
|00000800| 70 6c 61 6e 65 73 20 69 | 6e 20 74 68 69 73 20 63 |planes i|n this c|
|00000810| 61 73 65 2e 22 20 20 42 | 75 74 20 74 68 61 74 27 |ase." B|ut that'|
|00000820| 73 20 67 65 6e 65 72 61 | 6c 6c 79 20 70 6f 6f 72 |s genera|lly poor|
|00000830| 20 64 65 73 69 67 6e 2e | 0a 0a 2c 2d 2d 2d 2d 2d | design.|..,-----|
|00000840| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000850| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000860| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000870| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2e 0a 7c |--------|-----..||
|00000880| 20 20 20 20 4a 6f 73 65 | 70 68 20 4a 2e 20 53 74 | Jose|ph J. St|
|00000890| 72 6f 75 74 20 20 20 20 | 20 20 20 20 20 20 20 44 |rout | D|
|000008a0| 65 70 61 72 74 6d 65 6e | 74 20 6f 66 20 4e 65 75 |epartmen|t of Neu|
|000008b0| 72 6f 73 63 69 65 6e 63 | 65 2c 20 55 43 53 44 20 |roscienc|e, UCSD |
|000008c0| 20 20 7c 0a 7c 20 20 20 | 20 6a 73 74 72 6f 75 74 | |.| | jstrout|
|000008d0| 40 75 63 73 64 2e 65 64 | 75 20 20 20 20 20 20 20 |@ucsd.ed|u |
|000008e0| 20 20 20 20 68 74 74 70 | 3a 2f 2f 77 77 77 2d 61 | http|://www-a|
|000008f0| 63 73 2e 75 63 73 64 2e | 65 64 75 2f 7e 6a 73 74 |cs.ucsd.|edu/~jst|
|00000900| 72 6f 75 74 2f 20 20 7c | 0a 60 2d 2d 2d 2d 2d 2d |rout/ ||.`------|
|00000910| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000920| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000930| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000940| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 27 0a 54 68 |--------|----'.Th|
|00000950| 69 73 20 6d 65 73 73 61 | 67 65 20 69 73 20 43 6f |is messa|ge is Co|
|00000960| 70 79 72 69 67 68 74 20 | 28 43 29 20 31 39 39 36 |pyright |(C) 1996|
|00000970| 20 62 79 20 4a 6f 73 65 | 70 68 20 4a 2e 20 53 74 | by Jose|ph J. St|
|00000980| 72 6f 75 74 2e 20 20 52 | 65 64 69 73 74 72 69 62 |rout. R|edistrib|
|00000990| 75 74 69 6f 6e 20 0a 76 | 69 61 20 74 68 65 20 4d |ution .v|ia the M|
|000009a0| 69 63 72 6f 73 6f 66 74 | 20 4e 65 74 77 6f 72 6b |icrosoft| Network|
|000009b0| 20 69 73 20 65 78 70 72 | 65 73 73 6c 79 20 70 72 | is expr|essly pr|
|000009c0| 6f 68 69 62 69 74 65 64 | 2e 0a |ohibited|.. |
+--------+-------------------------+-------------------------+--------+--------+